import {request} from '../utils/index.js';

export default {
    get:async ()=>
   await request({
        type:'get',
        url:'/api/indent/'
    }),
    
    addIndent:async (add)=>
    await request({
        type:'post',
        url:'/api/indent/add',
        data:add
    }),
    //分页
    inCur: ({ curPage = 1, eachPage = 10 } = {}) => request({
        type: "get",
        url: "/api/indent/inCur",
        data: { curPage, eachPage }
    }),
    // 获取用户数据
    uses:async ()=>{
       return await request({
            type:"get",
            url:"/api/indent/users"
        })
    },
    
    //获取放映厅数据
    load:()=>
        request({
            type:"get",
            url:"/api/indent/theaters/getAll"
        }),
     // 获取影院数据
     cinemas: async ({ curPage = 1, eachPage = 10 } = {}) => {
        return await request({
            type: "get",
            url: "/api/indent/cinemas",
            data: { curPage, eachPage }
        })
    },
    //获取排片数据
    getSc:async ()=>{
       return await request({
            type: "get",
            url: "/api/indent/schedules",
         
        })
    },
    // 新增选座
    creatSting:async ({ seatsId,scheduleId,seating,status})=>{
      const a=  JSON.stringify(seating)
    
        return await request({
             type: "post",
             url: "/api/seating/addSeat",
             data:{ seatsId,scheduleId,a,status}
         })
     },
     //查询订单
     getIndentOne:async (data)=>{
        return await request({
            type: "get",
            url: "/api/indent/getOne",
            data:data 
        })
    },
    //通过选座id查找座位
    getSeating:async ({seatingId})=>{
        return await request({
            type: "get",
            url: "/api/seating/checkSeat",
            data:{seatingId} 
        })
    },
    //查询所有选座
    checkSe:async ()=>{
        return await request({
            type: "get",
            url: "/api/seating",
          
        })
    }
}